package teacher.action;

import teacher.bean.Project;
import teacher.service.flow;
import teacher.service.project;

import com.opensymphony.xwork2.ActionSupport;

public class deletePro extends ActionSupport {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int projectid;
	String suc;

	public String getSuc() {
		return suc;
	}

	public void setSuc(String suc) {
		this.suc = suc;
	}

	public int getProjectid() {
		return projectid;
	}

	public void setProjectid(int projectid) {
		this.projectid = projectid;
	}

	public String execute() throws Exception {
		
		Project pro=new Project();
		pro.setProId(projectid);
		if(new flow().DeleteFlow(projectid, 4))//删除流程
		{System.out.println("删除流程成功！！！");}
		if(new project().DeleteProject(pro))
		{
			this.setSuc("success");
		return SUCCESS;}
		else{
			return ERROR;
		}
	}


	
}
